package AdapterPattern;

public class MediaAdapter implements MediaPlayer{

    AdvancedMediaPlayer advancedMediaPlayer;

    public void play(String type, String fileName) {
        if(type.equals("mp4")){
            advancedMediaPlayer.playMP4(fileName);
        }else if(type.equals("vlc")){
            advancedMediaPlayer.playVlc(fileName);
        }
    }

    public MediaAdapter(String audioType) {
        if(audioType.equals("vlc")){
            advancedMediaPlayer  = new VlcPlayer();
        }else if(audioType.equals("mp4")){
            advancedMediaPlayer = new MP4Player();
        }
    }
}
